package com.taotao.service;

import com.taotao.entity.GateWayEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjin
 * @title: ApiGatewayService
 * @projectName sw-gateway
 * @description: 配置动态接口
 * @date 2021/12/8 15:45
 */
@RestController
public class ApiGatewayService {

    @Autowired
    private MayiktGatewayService mayiktGatewayService;

    @RequestMapping("/deleteGateway")
    public String deleteGateway(String routeId) {
        mayiktGatewayService.deleteConfig(routeId);
        return "ok";
    }

    @RequestMapping("/addGateway")
    public String addGateway(@RequestBody GateWayEntity gateWayEntity) {
        mayiktGatewayService.addConfig(gateWayEntity);
        return "ok";
    }


}
